package com.glsc.ngateway.common.api.flowable.dto.param;

import com.glsc.ngateway.common.api.flowable.dto.demand.ParamDoTaskDtoBuilder;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Map;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ParamDoTaskDto implements Serializable {

//    {
//        "taskId":"1b66789b-106e-11ec-b89a-000c299a9069",
//            "comment":"",
//            "content":"{\"title\":\"中文名称标题\",\"money\":\"35000000\"}",
//            "sysid":"am"
//    }

    @ApiModelProperty(value = "任务id")
    private String taskId;

    @ApiModelProperty(value = "评论附言")
    private DoTaskCommentDto comment;

    @ApiModelProperty(value = "表单内容")
    private String content;

    @ApiModelProperty(value = "第三方系统名称")
    private String sysid;

    //"taskAssignee\":{\"userGroup\":\"lm1,lm2\"}
    @ApiModelProperty(value = "流程节点办理人")
    private Map<String, String> taskAssignee;

    @ApiModelProperty(value = "条件判断变量")
    private Map<String, String> conditionalVariable;

    @ApiModelProperty(value = "忽略处理权限, yesno")
    private String taskActionAuthIgnore;

    /**
     * 目前只有platform侧使用到
     * TODO:统一前端接口参数
     */
    @ApiModelProperty(value = "流程标题")
    private String title;

    public ParamDoTaskDto(ParamDoTaskDtoBuilder builder) {
        this.taskId = builder.getTaskId();
        this.comment = builder.getComment();
        this.content = builder.getContentstr();
        this.sysid = builder.getSysid();
        this.taskAssignee = builder.getTaskAssignee();
        this.conditionalVariable = builder.getConditionalVariable();
    }

}
